package com.itcam.tingshu.account.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.itcam.tingshu.common.result.Result;
import com.itcam.tingshu.model.account.UserAccount;
import com.baomidou.mybatisplus.extension.service.IService;
import com.itcam.tingshu.model.account.UserAccountDetail;
import com.itcam.tingshu.vo.account.AccountLockResultVo;
import com.itcam.tingshu.vo.account.AccountLockVo;

public interface UserAccountService extends IService<UserAccount> {


    /**
     * 初始化用户账户
     * @param userId
     */
    void initUserAccount(String userId);

    /**
     * 检查锁定账户金额
     * @param accountLockVo
     * @return
     */
    AccountLockResultVo checkAndLock(AccountLockVo accountLockVo);

    /**
     * 监听扣减金额
     * @param orderNo
     */
    void minus(String orderNo);

    /**
     * 监听解锁金额
     * @param orderNo
     */
    void accountUnlock(String orderNo);

    /**
     * 监听消息实现用户账户充值
     * @param orderNo
     */
    void rechargePaySuccess(String orderNo);

    /**
     * 获取充值记录
     * @param detailPage
     * @param userId
     * @return
     */
    IPage<UserAccountDetail> findUserRechargePage(Page<UserAccountDetail> detailPage, Long userId);

    /**
     * 获取消费记录
     * @param detailPage
     * @param userId
     * @return
     */
    IPage<UserAccountDetail> findUserConsumePage(Page<UserAccountDetail> detailPage, Long userId);
}
